Unofficial addons For Operation Flashpoint: Resistance
by Bullz_Eye_On_My_Back : ofpadd2003@yahoo.com
Scripting does require Resistance

###################################################################################
Table of Content
1. SPECIAL THANKS
2. FOLDER CONTENT
3. QUALITY DISCLAIMER
4. DESCRIPTION OF INTERFACE
5. USES THAT CAN BE IMPLEMENTED
6. OVERALL DISCLAIMER

###################################################################################
1. SPECIAL THANKS

Uiox ~~ for the interface texture and having a look at his warrior resource file
vektorboson ~~ for demos on description files and creating dialogs
Dschulle ~~ for lending an ear for my scripting problems from time to time....
	... and most of all letting me use his helmet cam script
###################################################################################
2. FOLDER CONTENT

Addon~ It is found under "Civilian\Car\Positioning Tool" in the editor

The Zipped folder contains:
Addon~ It is found under "Civilian\Car\Positioning Tool" in the editor
 Inside is a model and the Scripts.
Place the addon in the editor and place a "description.ext" file into the folder and inside place " #include <bullzeye\resource.cpp>" into it. 
Place your objects (air, vehicle,camera, object, etc.) and name them cam1, cam2, cam3.....all the way up to cam999
One Sample mission on how to set it up

###################################################################################
3. QUALITY DISCLAIMER

Version 1.0 (first beta-release)
Quality Disclaimers:

~Scripts
1. I'm still a newbie at scripting
	a. There might be a better and more efficient way to implementing this tool and the use of cameras
	b. When exiting the dialog by pressing escape it will reset the object to its original position
	c. I tried making the values of the sliders from camera to camera view equal but it made it buggy 
	d. I haven't tested all 999 names ... I've looked through the file and i believe i caught all the mistakes
	e. when selecting a new object or exiting the current object and selected object will slightly move
	f. I've never made a mission before so I do know its a pain to position things. I don't know the quick short cuts but thought
	   this would give a tool to shorten time that mission makers use on placing objects and things. 
	
###################################################################################
4. DESCRIPTION OF INTERFACE
 Addons by: Bullz_eye_on_my_back

1. Top of screen (from left to right)


	CHOSING TYPES OF VIEW

	a. Title Exit\View ~~ The box below the title toggles between Positioning View, Camera View, and Exit.
		1. Positioning View shows the view from where you stand and direction that you look from when you start the dialog
		2. Camera View will put you into the Selected Camera view in the list box in the Frame "Camera Controls"
		      note: By selecting a view and pressing the "sim" button it will automatically take you to the camera view.	
		3. Exit - exits the dialog
	*****NOTE: If you use the escape key to exit the dialog the object will be placed to its original position. So ALWAYS
		ALWAYS use exit if you want the object to remain at its place.
		Also, the objects being selected and previously selected will move slightly after exiting or selecting.
		
	CHOSING SPECIFIC OBJECTS (OBJECT SELECTION)
	*** on start up of dialog it will automatically default to cam1

	b. Tittle Object ~ The three boxes below will cooralate with the number you assigned to the object.
		           Ex. cam34 = 034     
		1. Each box numbers from 0 to 9. So you are given the ability to place 999 objects in the game and move them around to 
		    where you desire. 
	
	c.  Tittle Placement~  This list box gives you 3 options as to player to object relation when selecting an object
		1. As Is ~ Keeps both the player and object at its given position
		2. In Front ~ Places the object in front of the player the assigned distance from the "meters" list box (position to player's hieght)
		3. Place Player ~ Places the player infront of the object the assigned distance from the "meters" list box (position to object's hieght)
			   note: Be sure that it will not position you over water or high up.

	d. Tittle Meter ~  This list box gives you the option of how far to place you or the object from each other
		1. Gives the option of 5, 10, 15, 20, and 25 meters.

	e. Set Button ~ This sends the readouts to the proper scripts and selects the position and object to manipulate.

	GETTING OBJECTS POSITIONING
	
	f. Obj. Position Frame~ This Gives a readout of the objects x, y, z coordinates. As well as the objects direction.
		 For beginners: This can be used with the command setpos and setdir
		ex. Using Cam1 as object again...
		
		To set the object the commands will be....
		cam1 setpos [x,y,z]   

		To get the coordinates from script it uses the getpos command (this gives the readout)
		getpos cam1 select 0  ..... which is the x-coord.
		getpos cam1 select 1 ...... which is the y-coord.
		getpos cam1 select 2 ...... which is the z-coord.

		To set the direction
		cam1 setdir <readout>
		
		The readout uses the command getdir for this
		getdir cam1

		How to use in the Security Camera Scritps.....
		1. Say our readouts are (for cam1)
			x-coord: 7735.55
			y-coord: 4417.8
			z-coord: 1.93
			Direction: 120
		
		
		Go to the file folder "Positions" open up the file "stationarycams.sqs"
		Then to set the position and direction of cam1 place this in the script
		
		cam1 setpos [7735.55,4417.8,1.93]
		cam1 setdir 120
		
		This will position the camera exactly the way you had it in your view in the positioning tool


2. Bottom of the screen from Left to right (each section from the top down)

	POSITIONING THE OBJECT 
	Note: All is taken from the initial position and direction.
	**** Can be used during Camera View*******
	
	a. Tittle Fine Tune ~ The list box will give you the option of "Yes" or "No" to fine tunning the position.
		1. What it actually does is sets all of the sliders beneath it to a quarter of their value to be able to position better
		Note: Fine tunning can be achieved by clicking on the arrows to the sides of the sliders or on the slider itself

	b. Forwards\ Backwards Slider~ Positions the object Forward or Backwards with a distance of 25 meters each direction in relation
			                to beginning position.

	c. Left\Right Slider~Positions the object Left or Right with a distance of 25 meters each direction in relation
		             to beginning position.
	
	d. Hieght Slider ~Positions the object Above or Below with a distance of 25 meters each direction in relation
		          to beginning position.

	e. Direction ~ Changes the direction of the object to any of the degrees ranging from 0 to 360 
		     note: Slider will be defaulted to the current objects direction.

	
	USING THE CAMERA VIEWS


	f. Tittle Camera Simulation ~ This List box gives 7 posible camera simulation types. It is changed by selecting and chosing "Camera View" or hitting the "Sim" button
		1. Right ~ This is in relation to the Security Cam Scripts for a Camera looking to the right. Non- animated.
		2. Left ~ This is in relation to the Security Cam Scripts for a Camera looking to the left. Non- animated.
		3. Straight ~This is in relation to the Security Cam Scripts for a Camera looking to straight ahead. Non- animated.
		4. Standard Animation ~ This is in relation to the Security Cam scripts for a camera with a standard left to right animation.	
				     The animation can be simulated by hitting the "Start" and "Stop" buttons under the title "Animation"
		5. Altered Animation ~ This is in relation to the Security Cam Scripts for a camera with an altered left to right animation.
				  The animation can be simulated by hitting the "Start" and "Stop" buttons
				Note: Change the sliders _b and _dir to alter the animation direction and distance of rotation
				        _b is in conjunction with the distance of animation
				       _dir is the starting direction of the camera
				       The changes will only take place if you stop the animation first and then hit start.
		6. Other ~ This is unrelated to the Security Cam Scripts but will give the ability to look in all 360 degrees around the object.
		7. Target Object ~ This is unrelated and will allow you to move the camera in a distance of 40 meters in all planes while only 
			            looking straight at the object. 
			            Note: This is the defualt Camera View and is good for positioning the object in place.

	g. Tittle Animations ~ These two buttons "Start" and "Stop" the animations.

	h. _b slider ~ This is in relation to the animation scripts in the Security Cam Scripts.
		     The values from camera simulation to camera simulation will vary.

		How to use with Security Cam Scripts...
		Goto the file folder "Rotate_Scripts" and to the file in conjunction with the camera.
		For example "rotate_script1.sqs"  
		In the demo mission this is a Camera looking to the Left.
		As you will see in the Camera Simulated "Left" view  _b will equal "exit"

		So therefore below the calling of script execution <[] exec "cameras\sec_cam1.sqs">

		place a  <goto "exit">  ..... this will make sure that the camera view is not rotated
		
		Likewise Right Views will be handled the same way. 

		For a Standard Animation: Nothing will have to be done to the script (seen in "rotate_script7.sqs"

		For an Altered Animation some editing will be required. (seen in demo cam6)
			1. Read off the _b value... 
	Following is the script for "rotate_script6.sqs" which the _b value would read 70  (and _dir =40)

	where it has the following:  _a = (getdir cam6 + 70-240+40)
			       _b = 70
		and: _a = (scam6dir - 70)
		       _b = 70
	As you see the first _a should be    _a =( getdir cam6 + _b -240 +_dir)
		and the second              _a = (scam6dir - _b)

		So place the value found to be equal to _b  and everywhere that the _b should be placed in the _a equation
#################################################################################################

[] exec "cameras\sec_cam6.sqs"

#loopstart
~4
_a = (getdir cam6 + 70-240+40)
_b = 70
goto "nocorrection"



#nocorrection

_c= 0

goto "loop"

#loop
_c= _c +0.5
?(! alive cam6): goto "exit"
?!(getpos checks select 2 <=10050 && getpos checks select 2 >= 9950): goto "exit"
?(! alive tv6): goto "exit"
scam6dir = (_a - _b + _c)
~0.02

?(_c <_b): goto "loop"
?(_c>=_b): goto "loopback"

#loopback
~4
_a = (scam6dir - 70)
_b = 70
goto "nocorrection1"


;***************correction 1*******************
; a different loop is needed for minus degrees
#nocorrection1
_c= 0
_d=( _a+ _b)

goto "loop1"

#loop1
_c= _c +0.5
?(! alive cam6): goto "exit"
?!(getpos checks select 2 <=10050 && getpos checks select 2 >= 9950): goto "exit"
?(! alive tv6): goto "exit"

scam6dir = (_d -_c)
~0.02

?(_c <_b): goto "loop1"
?(_c>=_b): goto "loopstart"
#exit
exit
######################################################################################################################


	d. _dir slider ~ This is in relation to the Security Camera Scripts in the folder "Cameras" and "Sec_cam#.sqs" file
		     The values from camera simulation to camera simulation will vary.
			
		In the "Sec_cam#.sqs" file there are only two places to change the value which is in the "CamCreat" and "Loop" section
		this variable is also named _dir
		1. For Left and Standard Animated Views  _dir =0
		2. For Right View _dir = 130
		3. For Straight View _dir = 60
		5. For Alterd View _dir value will vary and will have to be edited in the "sec_cam#.sqs" file and the related "rotate_script#.sqs" file
		    as shown above.

	f. _ldown slider ~ Is related to the Security Camera Scripts in the folder "Cameras" and "Sec_cam#.sqs" file
		     The values are entirely up to you. They determine the angle in which the camera points downwards.
		     The default is at 6.  
		
		In relation to the Security Cam Scripts just replace the readout with the value for _ldown.

	g. _hieght slider ~ Is related to the Security Camera Scripts in the folder "Cameras" and "Sec_cam#.sqs" file
		           The values vary greatly depending on the objects positioned height.  You will have to first set it up
		              where you can see the camera and get close to the right hieght and use the arrows to fine tune it.
		           This determines the height of the camera position in relation to the object.

		In relation to the Security Cam Scripts just replace the readout with the value for _height.

	h. Lft\Rght Slider ~ Is no relation to the Security Cams but to the "Target Object" Camera View
		            It moves the camera left and right in relation to the objects position and direction.

	i. _fact slider ~ is related to the Security Camera Scripts in the folder "Cameras" and "Sec_cam#.sqs" file
		       This moves the camera forward or backward in relation to the objects position and direction.
		       This is typically 1, but entirely up to you for the effect.
		
	In relation to the Security Cam Scripts just replace the readout with the value for _fact.

	j. _zoom Slider ~ is related to the Security Camera Scripts in the folder "Cameras" and "Sec_cam#.sqs" file
		          This makes the camera zoom in or out. The values range from 0.1 to 2 - lower being a high zoom effect.
		          These values will vary for the effect you want.

		In relation to the Security Cam Scripts go to where it says (for example "sec_cam1.sqs" file)
		_zoom = 1
		
		The script  calls for a zoom of 0.85     "sCam1 camSetFOV 0.85"
		So replace it by "sCam1 camSetFOV 1.0"

#############################################################################################################################3		

5. USES THAT CAN BE IMPLEMENTED

	a. This was primarly written for the use of the Security Cameras since it is time consuming to place and you can view it at the same time.
	    All you have to do is place the cam ..position the camera view and write down the read outs and place them in the right places in the script.
	    Note: The Sec. Camera Scripts can also be applied to vehicles too....it will move with the object.
	
	b. This can be used for mission makers trying to get the right position for all of the objects in the game....whether it be objects, vehicles, or players.
	     Just write down the "Obj. Position" Readouts and put them into the script or initilzation lines.
	     Now it makes placing things in buildings a lot easier and faster.
	     Just place your objects in the editor in close proximity of where you want it and start positioning the objects.

	d. Ever wanted the exact position to where you want a missle or bomb to be dropped on for cut scenes or for affect or triggers in game play.
	    Just use an object and position it to get the right coords.
	e. It's great for fence laying! :)  
	f. It uses the 2nd generation of Sec. Cameras
I hope everyone can use it and it helps make everyone's mission making time more efficient and faster!!!!!

#############################################################################################################################
6. OVERALL DISCLAIMER

This is NOT an official Addon. Use it at your own risk. The author does not guarantee
that this software will be fit to serve any purpose. The author will not be held
responsible for any damage these addons might incur, nor will he be responsible for
any problems you might encounter in installing or using this addon.















